package main

import "fmt"

type Student struct {
	Name  string
	Age   int
	Score int
}
type Pupil struct {
	//这就是继承
	Student
}

func (p *Student) ShowInfo() {
	fmt.Printf("名字 %v 年龄%v 成绩%v\n", p.Name, p.Age, p.Score)
}
func (p *Pupil) SetScore(score int) {
	p.Score = score
}
func (p *Pupil) testing() {
	fmt.Println("小学生正在考试中")
}

func main() {
	p := &Pupil{}
	p.Student.Name = "小学生"
	p.testing()
	p.SetScore(100)
	p.ShowInfo()
	fmt.Println("ok")
	c := &C{}
	c.B.name()
}

type A struct {
}

func (a *A) name() {
	fmt.Println("A name")
}

type B struct {
}

func (a *B) name() {
	fmt.Println("b name")
}

type C struct {
	A
	B
}
